# -*- coding: utf-8 -*-
"""
@Time   : 2019/11/21 11:48
@Author : LeeCQ
"""

import os ,time

from bencode import bdecode, bencode

f_torrent = 'F:/迅雷下载/1F24130C5B3036F470B66A78F0C14509B1EB2486.torrent'


def no():

    t = open(f_torrent, 'rb').read()
    t = bdecode(t)
    # print(t)
    t[b'info'][b'name'] = b'rename.zip'.decode('utf8')
    print(t)
    t = bencode(t)

    open('./a.test.torrent', 'wb').write(t)


if __name__ == '__main__':
    no()
